package org.cli.admin.glassfish.context;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class GlassfishContext {
	private Map<String,GlassfishDomain> installations = Collections.synchronizedMap(new HashMap<String,GlassfishDomain>());
	
	private Map<String,DeployTarget> targets = Collections.synchronizedMap(new HashMap<String,DeployTarget>());
	
	private Map<GlassfishDomain, Process> processes = Collections.synchronizedMap(new HashMap<GlassfishDomain, Process>());

	public Map<String,DeployTarget> getTargets() {
		return Collections.unmodifiableMap(targets);
	}
	
	public DeployTarget getTarget(String name) {
		return this.targets.get(name);
	}

	public void addTarges(String name,DeployTarget target) {
		this.targets.put(name,target);
	}

	public Map<String,GlassfishDomain> getInstallations() {
		return Collections.unmodifiableMap(installations);
	}

	public void addInstallation(String name, GlassfishDomain installation) {
		this.installations.put(name,installation);
	}
	
	public Map<GlassfishDomain, Process> getProcesses() {
		return processes;
	}

	public void addProcess(GlassfishDomain installation, Process process) {
		processes.put(installation, process);
	}
	
}
